package homework.api03.exercises02;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;

public class CollectionDemo1 {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        //Collection c = new HashSet();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        c.add("one");

        System.out.println(c);

        System.out.println("siaze:"+c.size());
        System.out.println("是否为空集:"+c.isEmpty());
        c.clear();//清除
        System.out.println("集合已清空");
        System.out.println("size:"+c.size());
        System.out.println("是否为空集:"+c.isEmpty());

    }
}
